<script src="jquery-1.4.2.min.js"></script>
<script>
$(function(){
	$("a").click(function(){
		$('a').removeClass('on');
		$(this).addClass('on');
	});
});
</script>
<style>
.on{
	background:#ff0000;
	border-left:5px solid #0000ff;
	padding-left:5px;
}
a{
	color:#0000ff;
	font-size:14px;
}
.empty{
	color:#cccccc;
}
.imp{
	background:#000000;
	color:#ffffff;
}
</style>
<?php
//重要的表
$imp_tables = explode(',', 'NG_SUM_FIXED_C,NG_EVENTTYPES,NG_FLIGHTS,NG_INSERTIONORDERS,NG_ADVERTISERS');

$dbh = new PDO("oci:dbname=adDB", "readonly", "7G70ggBZ");
//显示所有表
//select table_name from all_tables where owner='ADMANAGER70'
$res = $dbh->query("select table_name from all_tables where owner='ADMANAGER70'");
$res->setFetchMode(PDO::FETCH_ASSOC);
$rs = $res->fetchAll();
foreach ($rs as $item) {
	//是否为空
	if(1) {
		$res2 = $dbh->query("select count(*) from ADMANAGER70.{$item['TABLE_NAME']} where rownum=1");
		$rs2 = $res2->fetch();
		$style = ($rs2[0] == 0 ?  'empty' : '');
	}
	$style = (in_array($item['TABLE_NAME'], $imp_tables) ?  'imp' : $style);
	echo '<a href="frame_right.php?table='.$item['TABLE_NAME'].'" target="frame_right" class="'.$style.'">'.strtolower($item['TABLE_NAME']).'</a><br />';
}
echo count($rs);
?>